def douhao(list):
  str=''
  for i in range(len(list)):
    if i ==(len(list)-1):
      str=str+'and'+list[i]
    elif i==(len(list)-2):
      str=str+list[i]
    else:
      str=str+list[i]+','
  return str

spam=['1','2','3','4']
print(douhao(spam))
